package com.jj.service.impl;

import com.jj.dao.EmployeeDao;
import com.jj.dao.impl.EmployeeDaoImpl;
import com.jj.entity.Employee;
import com.jj.service.EmployeeService;

public class EmployeeServiceImpl implements EmployeeService {
    private EmployeeDao employeeDao = new EmployeeDaoImpl();
    @Override
    public Employee getEmployeeById(int id) {
        return employeeDao.getEmployeeById(id);
    }

    @Override
    public boolean addEmployee(Employee employee) {
        return employeeDao.addEmployee(employee) > 0? true : false;
    }

    @Override
    public boolean updateEmployee(Employee employee) {
        return employeeDao.updateEmployee(employee) > 0? true : false;
    }

    @Override
    public boolean deleteEmployee(int id) {
        return employeeDao.deleteEmployee(id) > 0? true : false;
    }
}
